<template>
  <div v-if="showType === 'tag'">
    <el-tag v-if="currentStatusKey" :type="EFocusStatusType[currentStatusKey]">
      {{ currentStatusKey }}
    </el-tag>
  </div>
  <span v-else>{{ currentStatusKey }}</span>
</template>

<script setup lang="ts">
import { EFocusStatus, EFocusStatusType } from '@/components/statusShow/util'
import { computed } from 'vue'
// 显示按钮类型，默认tag
type ShowButtonType = 'tag' | 'text'
/**
 * 任务状态展示
 */
const { status, showType = 'tag' } = defineProps<{
  status: number | undefined
  showType?: ShowButtonType
}>()

const currentStatusKey = computed(() => {
  if (status !== 0 && !status) {
    return null
  }
  return EFocusStatus[status] as keyof typeof EFocusStatus
})
</script>

<style scoped lang="scss"></style>
